package model;

import java.awt.Image;
import java.io.Serializable;
import javax.swing.ImageIcon;

/*
 * This is the photo model.
 * It can contain a photo which can be used by the ImageView class.
 */
public class Photo implements Serializable{

    private int id;
    private String path;
    private ImageIcon imageIcon;

    public Photo(int id, String path, ImageIcon imageIcon) {
        this.id = id;
        this.path = path;
        this.imageIcon = imageIcon;
    }

    public Photo(int id, String path, Image image) {
        this(id, path, new ImageIcon(image));
    }

    public int getId() {
        return id;
    }

    public Image getImage() {
        return imageIcon.getImage();
    }

    public String getPath() {
        return path;
    }
}
